<template>
  <el-table
    :data="tableData"
    style="width: 100%"
    border
  >
    <el-table-column
      prop="id"
      label="序号"
    />
    <el-table-column
      prop="device"
      label="生产设备"
    />
    <el-table-column
      prop="code"
      label="编码"
    />
    <el-table-column
      prop="model"
      label="型号"
    />
    <el-table-column
      prop="productTime"
      label="生产日期"
    />
    <el-table-column
      prop="batchNumber"
      label="生产批号"
    />
    <el-table-column
      prop="manufacturer"
      label="制造商"
    />
    <el-table-column
      label="操作"
    >
      <template slot-scope="scope">
        <el-button type="text" size="small" @click="handleClick(scope.row)">编辑</el-button>
        <el-button type="text" size="small">删除</el-button>
        <el-button type="text" size="small" @click="dialogTableVisible = true">物料分配</el-button>
      </template>
    </el-table-column>
  </el-table>
</template>

<script>
import { getProduct } from '@/api/factory'
export default {
  name: 'NestTable',
  props: {
    dialogTableVisible: {
      type: Boolean
    }
  },
  data() {
    return {
      tableData: [],
      params: {
        pageNo: 1,
        pageSize: 10
      },
      total: 0
    }
  },
  methods: {
    async getData(id) {
      const res = await getProduct(id)
      console.log(res)
      this.tableData = res.true
      this.total = res.totalElements
    }
  }
}
</script>

<style>

</style>
